<template>
    <!--用于登录和注册页面的大标题-->
    <view id="ls_topic">
        <span>{{ title }}</span>
        <span id="typed-title"></span><br>
    </view>
</template>

<style scoped>
#ls_topic {
    display: block;
    margin-top: 15rex;
    
    text-align: center;
}

#ls_topic span:first-child {
    display: block;
    font-family: "harmony_os";
    font-weight: bold;
    font-size: 2.5em;

    color: rgb(68, 68, 68)
}

#typed-title {
    width: 240px;

    position: relative;

    font-size: 1.2em;
    font-family: "harmony_os";
    color: gray;
    line-height: 50px;
}
</style>

<script>
import Typed from 'typed.js';
import { onMounted } from 'vue';
export default{
    name: 'topic',
    props:{
        title: {
            type: String,
        },
        subtitle: {
            type: Array,
        }
    },
    setup(props){
        onMounted(() => {
            new Typed('#typed-title', {
                strings: props.subtitle,
                typeSpeed: 100,
                loop: false,
                backSpeed: 50,
            });
        })
    }
}
</script>